
import React from "react";
// 导入路由
import { BrowserRouter as Router, Route, Switch, Redirect } from "react-router-dom";
import Login from "./pages/Login";
import Layout from "./pages/Layout";
import NotFound from "./pages/NotFound";
import { AuthRoute } from "@/components/AuthRoute";
import history from "./utils/history";
export default function App() {
  return (
    <div>
      <Router history={history}>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <Route exact path="/" render={() => <Redirect to="/home"></Redirect>}></Route>
          {/* <Route path="/home" component={Layout}></Route> */}
          <AuthRoute path="/home" component={Layout}></AuthRoute>
          <Route>
            <NotFound></NotFound>
          </Route>
        </Switch>
      </Router>
    </div>
  );
}
